import 'dart:convert';
import 'package:test_flutter/model/LanguageModel.dart';
import 'package:test_flutter/utils/common_utils/SpUtil.dart';
import 'package:test_flutter/utils/common_utils/common.dart';
import 'package:test_flutter/utils/common_utils/object_util.dart';

class SpHelper {
  static LanguageModel getLanguageModel() {
    String _saveLanguage = SpUtil.getString(Constant.keyLanguage);
    if (ObjectUtil.isNotEmpty(_saveLanguage)) {
      Map userMap = json.decode(_saveLanguage);
      return LanguageModel.fromJson(userMap);
    }
    return null;
  }
}